Now that proc-macro crates can reexport from their dependencies we need to be
able to find the other crates, so ensure that we pass an appropriate -L flag.
Closes #3334
self.layout(unit.kind).build().join(dir).join("out")
}
+ pub fn host_deps(&self) -> &Path {
+ self.host.deps()
+ }
+
/// Returns the appropriate output directory for the specified package and
/// target.
pub fn out_dir(&mut self, unit: &Unit) -> PathBuf {
deps
});
+ // Be sure that the host path is also listed. This'll ensure that proc-macro
+ // dependencies are correctly found (for reexported macros).
+ if let Kind::Target = unit.kind {
+ cmd.arg("-L").arg(&{
+ let mut deps = OsString::from("dependency=");
+ deps.push(cx.host_deps());
+ deps
+ });
+ }
+
for unit in cx.dep_targets(unit)?.iter() {
if unit.profile.run_custom_build {
cmd.env("OUT_DIR", &cx.build_script_out_dir(unit));
--emit=dep-info,link \
--target {target} \
-C ar=my-ar-tool -C linker=my-linker-tool \
- -L dependency={dir}[/]target[/]{target}[/]debug[/]deps`
+ -L dependency={dir}[/]target[/]{target}[/]debug[/]deps \
+ -L dependency={dir}[/]target[/]debug[/]deps`
",
dir = p.root().display(),
url = p.url(),